

class Expression{
    interpret(string){

    }
}

class A extends Expression{
    constructor(desc){
        super()
        this.desc = desc
    }
    interpret(string){
        return this.desc.includes(string)
    }
}

/**
 * 
 * 并集
 * */
class And extends Expression{
    constructor(a,b){
        super()
        this.a = a
        this.b = b
    }
    interpret(string){
        return this.a.interpret(string) || this.b.interpret(string)
    }
}

/**
 * 
 * 交集
 * */
class Or extends Expression{
    constructor(a,b){
        super()
        this.a = a
        this.b = b
    }
    interpret(string){
        return this.a.interpret(string) && this.b.interpret(string)
    }
}
